{extend name="public:index"/} {block name="title"}{:sysconf('title')}{/block} {block name="content"}
<div class="whtop">
    <div class="top">
        <p class="p1">
            <a href="javascript:history.back(-1)"></a>
        </p>
        <p class="p2">合伙人申请</p>
        <p class="p3"></p>
    </div>
</div>
<div style="height:2rem;"></div>
<div class="zhu_ce1">
    <form id="certify">
        <div class="c-login-input">
            <div class="form-group">
                <label class="f16">姓名</label>
                <div class="pull-left">
                    <input name="partner_name" placeholder="请输入姓名" value="{$info['partner_name']}">
                </div>
            </div>
            <div class="form-group">
                <label class="f16">手机号</label>
                <div class="pull-left">
                    <input type="number" name="partner_mobile" placeholder="请输入手机号码" value="{$info['partner_mobile']}">
                </div>
            </div>
            <div class="form-group">
                <label class="f16">所在地区</label>
                <div class="pull-left">
                    <input  name="partner_city" placeholder="请输入所在地区" value="{$info['partner_city']}">
                </div>
            </div>
            <div class="Next_">
                {if condition="$info['is_partner'] eq 1"}
                <input style="outline:none;margin-top:2rem;background-color: #9c9c9c;" disabled type="button" value="已提交,待审核!"> {elseif condition="$info['partner'] eq 2"}
                <input style="outline:none;margin-top:2rem;background-color: #9c9c9c;" disabled type="button" value="已认证"> {elseif condition="$info['partner'] eq 3"}
                <input style="outline:none;margin-top:2rem;" id="submit" type="button" value="重新认证"> {else/}
                <input style="outline:none;margin-top:2rem;" id="submit" type="button" value="立即认证"> {/if}
            </div>
        </div>
    </form>
</div>
<script type="text/javascript">
 
    $("#submit").click(function() {
        var partner_name = $("input[name=partner_name]").val();
        var partner_mobile = $("input[name=partner_mobile]").val();
        var partner_city = $("input[name=partner_city]").val();
        if (partner_name == '' || partner_mobile == '' || partner_city == '') {
            layer.msg('请填写认证资料', {
                icon: 5
            });
            return false;
        }
        var obj = $(this);
        var goodsId = obj.data('id');
        $.ajax({
            url: "{:url('User/partner')}",
            type: "POST",
            data: {
                'partner_name': partner_name,
                'partner_mobile': partner_mobile,
                'partner_city': partner_city
            },
            dataType: "JSON",
            success: function(data) {
                if (data.code == 0) {
                    layer.msg(data.msg, {
                        icon: 6
                    }, function() {
                        window.location.reload();
                    })
                } else {
                    layer.msg(data.msg, {
                        'icon': 5
                    });
                }
            }
        });
    })
</script>
{/block}